import axios from '@/utils/request'
/**
 * 获取所有频道
 * @returns
 */
export function getAllChannels() {
  return axios({
    url: '/v1_0/channels'
  })
}

/**
 * 登录的用户请求添加频道
 * @param {*} channels
 * @returns
 */
export function addmouchannel(channels) {
  return axios({
    url: '/v1_0/user/channels',
    method: 'PATCH',
    data: {
      channels
    }
  })
}

/**
 * 登录用户删除指定的频道
 * @param {*} target
 * @returns
 */
export function delmouchannel(target) {
  return axios({
    url: `/v1_0/user/channels/${target}`,
    method: 'DELETE'
  })
}
